@using IdentityServer4.Extensions
@using Microsoft.AspNetCore.Mvc.Localization
@using SkorubaIdentityServer4Admin.Admin.Configuration.Interfaces
@inject IViewLocalizer Localizer
@inject IRootConfiguration RootConfiguration
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <link rel="icon" type="image/x-icon" href="@RootConfiguration.AdminConfiguration.FaviconUri" />
    <link rel="shortcut icon" type="image/x-icon" href="@RootConfiguration.AdminConfiguration.FaviconUri" />
    <title>@ViewData["Title"] - @RootConfiguration.AdminConfiguration.PageTitle</title>

    <environment include="Development">
        <link href="~/dist/css/bundle.min.css" asp-append-version="true" rel="stylesheet" />
        <link href="~/dist/css/web.css" asp-append-version="true" rel="stylesheet" />
    </environment>
    <environment exclude="Development">
        <link href="~/dist/css/bundle.min.css" asp-append-version="true" rel="stylesheet" />
        <link href="~/dist/css/web.min.css" asp-append-version="true" rel="stylesheet" />
    </environment>

    @RenderSection("styles", required: false)
</head>
<body>

    <div class="menu d-flex flex-column flex-md-row align-items-center p-3 px-md-4 mb-3 bg-white border-bottom box-shadow">
        <!--Site name -->
        <h3 class="menu-logo my-0 mr-md-auto font-weight-normal"><a class="logo" asp-area="" asp-controller="Home" asp-action="Index">@RootConfiguration.AdminConfiguration.PageTitle</a></h3>

        <!--Menu item -->
        <vc:identity-server-link></vc:identity-server-link>

        <!--Menu item -->
        <div class="menu-item my-2 my-md-0 mr-md-3 dropdown">
            <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
                @Localizer["TitleConfiguration"]
            </button>
            <div class="dropdown-menu">
                <a class="dropdown-item" asp-area="" asp-controller="Configuration" asp-action="Clients">@Localizer["LinkClients"]</a>
                <div class="dropdown-divider"></div>
                <a class="dropdown-item" asp-area="" asp-controller="Configuration" asp-action="IdentityResources">@Localizer["LinkIdentityResources"]</a>
                <a class="dropdown-item" asp-area="" asp-controller="Configuration" asp-action="ApiResources">@Localizer["LinkApiResources"]</a>
                <div class="dropdown-divider"></div>
                <a class="dropdown-item" asp-area="" asp-controller="Grant" asp-action="PersistedGrants">@Localizer["LinkPersistedGrants"]</a>
            </div>
        </div>

        <!--Menu item -->
        <div class="menu-item my-2 my-md-0 mr-md-3 dropdown">
            <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
                @Localizer["TitleUsermanagement"]
            </button>
            <div class="dropdown-menu">
                <a class="dropdown-item" asp-area="" asp-controller="Identity" asp-action="Users">@Localizer["LinkUsers"]</a>
                <a class="dropdown-item" asp-area="" asp-controller="Identity" asp-action="Roles">@Localizer["LinkRoles"]</a>
            </div>
        </div>

        <!--Menu item -->
        <div class="menu-item my-2 my-md-0 mr-md-3 dropdown">
            <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
                @Localizer["TitleLogs"]
            </button>
            <div class="dropdown-menu">
                <a class="dropdown-item" asp-area="" asp-controller="Log" asp-action="AuditLog">@Localizer["Audit Logs"]</a>
                <a class="dropdown-item" asp-area="" asp-controller="Log" asp-action="ErrorsLog">@Localizer["Error Logs"]</a>
            </div>
        </div>
        
        <!--Menu item -->
        @if (User.Identity.IsAuthenticated)
        {
            <a class="menu-item my-2 btn btn-outline-primary" asp-action="Logout" asp-controller="Account">@User.GetDisplayName() - @Localizer["LinkLogout"]</a>
        }

        <!--Menu button - show in < MD -->
        <a class="my-2 btn btn-outline-primary menu-button" href="#">
            <span class="oi oi-menu" title="menu" aria-hidden="true"></span> @Localizer["MenuButton"]
        </a>
    </div>

    <div class="container">
        @RenderBody()

        <footer class="pt-4 my-md-5 pt-md-5 border-top">
            <div class="row">
                <div class="col-6 col-md">
                    @RootConfiguration.AdminConfiguration.PageTitle
                    <small class="d-block mb-3 text-muted">@Localizer["FooterCopyright"] @DateTime.Now.Year</small>
                </div>
                <div class="col-md-6 text-right">
                    @await Html.PartialAsync("Common/SelectLanguage")
                </div>
            </div>


        </footer>
    </div>

    <environment include="Development">
        <script src="~/dist/js/bundle.min.js" asp-append-version="true"></script>
    </environment>
    <environment exclude="Development">
        <script src="~/dist/js/bundle.min.js" asp-append-version="true"></script>
    </environment>

    @await Html.PartialAsync("Common/Notification")

    @RenderSection("scripts", required: false)
</body>
</html>





